package com.rongshu.sendmessage.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.rongshu.sendmessage.R;
import com.rongshu.sendmessage.base.BaseActivity;
import com.rongshu.sendmessage.base.MyApplication;
import com.rongshu.sendmessage.util.APKVersionCodeUtils;
import com.rongshu.sendmessage.util.ToastUtils;
import com.rongshu.sendmessage.util.httpUtil.Common;
import com.rongshu.sendmessage.util.httpUtil.HYContent;
import com.rongshu.sendmessage.util.notifi.NotificationUtil;

public class AboutActivity extends BaseActivity {

    private Intent mIntent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        mContext=this;
        TextView title=findViewById(R.id.title);
        title.setText("关于我们");
        findViewById(R.id.titleLayLeft).setOnClickListener(view->finish());
        String versionName=APKVersionCodeUtils.getVerName(mContext);
        TextView tv_versionName = findViewById(R.id.tv_versionName);
        tv_versionName.setText("版本："+versionName);
    }

    public void onClick(View v) {
        if (v.getId()==R.id.ll_set_psw){
            mIntent=new Intent(mContext, EditPasswordActivity.class);
            startActivity(mIntent);
        }else if(v.getId()==R.id.ll_reset_bind_phone){
            mIntent=new Intent(mContext, ReSetPasswordActivity.class);
            startActivity(mIntent);
        } else if(v.getId()==R.id.ll_fuwu){
            Intent intent = new Intent(mContext, WebViewActivity.class);
//            intent.putExtra("webUrl", HYContent.getBASE_URL() + "/zcxy.html");
            intent.putExtra("source", "xieyi");
            startActivity(intent);
        }else if(v.getId()==R.id.ll_yinsi){
            Intent intent = new Intent(mContext, WebViewActivity.class);
//            intent.putExtra("webUrl", HYContent.getBASE_URL() + "/v_ysxy.html");
            intent.putExtra("source", "yinsi");
            startActivity(intent);
        }else if(v.getId()==R.id.ll_bangzhu){
            mIntent=new Intent(mContext, WebViewActivity.class);
            mIntent.putExtra("source","help");
//            mIntent.putExtra("webUrl",new Common().getRequstUrl()+"/bz.html");
            startActivity(mIntent);
        } else if(v.getId()==R.id.ll_about){
           //检测版本
            ToastUtils.show(mContext,"已经是最新版本了");
        }
    }
}